package com.ibm.productivity.tools.blogplugin.views;

import com.ibm.productivity.tools.blogplugin.meta.Article;
import com.ibm.productivity.tools.blogplugin.meta.Comment;

public class ArticleNode implements Comparable<ArticleNode> {

	public static final int COMMENTSTHRESHOLD = 100000;

	private int id;
	private String name;
	private ArticleParent parent;
	private Article article;
	private Comment comment;

	public ArticleNode(String name, int id) {
		this.name = name;
		this.id = id;
		article = null;
		comment = null;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getName() {
		return name;
	}

	public int getID() {
		return id;
	}

	public void setParent(ArticleParent parent) {
		this.parent = parent;
	}

	public ArticleParent getParent() {
		return parent;
	}

	public String toString() {
		return getName();
	}

	public int compareTo(ArticleNode o) {
		if (this.id < o.id)
			return -1;
		else if (this.id > o.id)
			return 1;
		return 0;
	}

	public Article getArticle() {
		return article;
	}

	public void setArticle(Article article) {
		this.article = article;
	}

	public Comment getComment() {
		return comment;
	}

	public void setComment(Comment comment) {
		this.comment = comment;
	}
}

